package com.qianli.cashmama.trade.common.enums;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2017/7/21
 * Time: 上午11:47
 */
public enum TimeoutTypeEnum {
    PRE_MESSAGE(1, "还款提前通知"),
    OVERDUE(2, "用于逾期"),
    WITH_HOLD(3, "当天代扣"),
    //SERVICE_PAYMENT(4, "服务费支付"),
    //NO_SERVICE_PAYMENT_TRADE_CLOSE(5, "支付服务费超时，交易订单关闭"),
    NO_SIGN_CLOSE(6, "信审通过未签名超时关闭"),
    NO_SIGN_REMIND(7, "信审通过未签名提醒"),
    OVERDUE_BLACKLIST(8, "逾期超过指定天数拉黑"),
    CHANGE_TO_OVERDUE_STATUS(9, "用于变更账单的状态为逾期状态"),
    USHA_POST_DATA(10, "推送给USHA相关订单文件信息"),
    USHA_POST_ORDER(11, "推送给USHA相关订单信息"),
    USHA_POST_REPAYMENT_INFO(12, "推送给USHA相关还款信息"),
    CHECK_HIGH_MARK(13, "检查high mark"),
    CHECK_HIGH_MARK_LOAN(14, "检查high markw完成之后的放款"),
    CREATE_CONTRACT_JOB(15, "生成合同"),
    PUSH_ORDER_TO_NODE_PROJECT(16, "推送订单到NODE项目"),
    PUSH_REPAYMENT_TO_NODE_PROJECT(17, "推送还款到NODE项目"),
    RONG360_BASE_AND_ORDER(18, "Rong360步骤1&2"),
    RONG360_REPAY(19, "Rong360步骤3"),
    DEDUCT_EXPIRATION(20, "抵扣失效任务"),
    ;

    private int type;
    private String desc;

    TimeoutTypeEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public int getType() {
        return type;
    }

    public TimeoutTypeEnum setType(int type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public TimeoutTypeEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }


    public static TimeoutTypeEnum conventByType(int type) {
        TimeoutTypeEnum timeoutTypeEnum = null;
        for (TimeoutTypeEnum typeEnum : TimeoutTypeEnum.values()) {
            if (typeEnum.getType() == type) {
                timeoutTypeEnum = typeEnum;
                break;
            }
        }

        return timeoutTypeEnum;
    }
}
